home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / Filezilla Server / FileZilla_Server-0_9_41.exe / source / interface / StatusView.cpp < prev    next >
C/C++ Source or Header  |  2011-11-06  |  3KB  |  117 lines

  1. // FileZilla Server - a Windows ftp server
  2.  
  3. // Copyright (C) 2002-2004 - Tim Kosse <tim.kosse@gmx.de>
  4.  
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9.  
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14.  
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. // StatusView.cpp: Implementierungsdatei
  20. //
  21.  
  22. #include "stdafx.h"
  23. #include "FileZilla server.h"
  24. #include "StatusView.h"
  25. #include "StatusCtrl.h"
  26. #include ".\statusview.h"
  27.  
  28. #if defined(_DEBUG) && !defined(MMGR)
  29. #define new DEBUG_NEW
  30. #undef THIS_FILE
  31. static char THIS_FILE[] = __FILE__;
  32. #endif
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CStatusView
  36.  
  37. IMPLEMENT_DYNCREATE(CStatusView, CView)
  38.  
  39. CStatusView::CStatusView()
  40. {
  41.     m_pStatusCtrl = new CStatusCtrl();
  42. }
  43.  
  44. CStatusView::~CStatusView()
  45. {
  46.     delete m_pStatusCtrl;
  47. }
  48.  
  49.  
  50. BEGIN_MESSAGE_MAP(CStatusView, CView)
  51.     //{{AFX_MSG_MAP(CStatusView)
  52.     ON_WM_CREATE()
  53.     ON_WM_SIZE()
  54.     //}}AFX_MSG_MAP
  55.     ON_WM_ERASEBKGND()
  56. END_MESSAGE_MAP()
  57.  
  58. /////////////////////////////////////////////////////////////////////////////
  59. // Zeichnung CStatusView 
  60.  
  61. void CStatusView::OnDraw(CDC* pDC)
  62. {
  63.     // ZU ERLEDIGEN: Code zum Zeichnen hier einfⁿgen
  64. }
  65.  
  66. /////////////////////////////////////////////////////////////////////////////
  67. // Diagnose CStatusView
  68.  
  69. #ifdef _DEBUG
  70. void CStatusView::AssertValid() const
  71. {
  72.     CView::AssertValid();
  73. }
  74.  
  75. void CStatusView::Dump(CDumpContext& dc) const
  76. {
  77.     CView::Dump(dc);
  78. }
  79. #endif //_DEBUG
  80.  
  81. int CStatusView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
  82. {
  83.     if (CView::OnCreate(lpCreateStruct) == -1)
  84.         return -1;
  85.  
  86.     // Create the style
  87.     DWORD dwStyle = WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_READONLY | WS_VSCROLL | ES_AUTOVSCROLL | ES_NOHIDESEL;
  88.     
  89.     // Create the list control.  Don't worry about specifying
  90.     // correct coordinates.  That will be handled in OnSize()
  91.     VERIFY(AfxInitRichEdit());
  92.     BOOL bResult = m_pStatusCtrl->Create(dwStyle, CRect(1, 1, 10, 10), this, 0);
  93.  
  94.     return (bResult ? 0 : -1);
  95. }
  96.  
  97.  
  98. // Override OnSize to resize the control to match the view
  99. void CStatusView::OnSize(UINT nType, int cx, int cy) 
  100. {
  101.     CView::OnSize(nType, cx, cy);
  102.     
  103.     if (::IsWindow(m_pStatusCtrl->m_hWnd))
  104.     m_pStatusCtrl->MoveWindow(0, 0, cx, cy, TRUE);
  105. }//OnSize
  106.  
  107.  
  108. void CStatusView::ShowStatus(LPCTSTR status, int type)
  109. {
  110.     m_pStatusCtrl->ShowStatus(status, type);
  111. }
  112.  
  113. BOOL CStatusView::OnEraseBkgnd(CDC* pDC)
  114. {
  115.     return TRUE;
  116. }
  117.